// UEXData.h: interface for the UEXData class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_UEXDATA_H__9696EA68_F97E_4EF6_932A_C8C2F6B41010__INCLUDED_)
#define AFX_UEXDATA_H__9696EA68_F97E_4EF6_932A_C8C2F6B41010__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "UeResbuf.h"

class AFX_EXT_CLASS UEXData  
{
	friend class UEXDataManager;
private:
	UEXData(const CString& strName);

private:
	enum{
		eREAD,
		eWRITE,
		eNOT};

	void SetState(INT nState);

public:
	virtual ~UEXData();
	
public:
	void AssertReadEnable();
	void AssertWriteEnable();
	void Add(struct resbuf* pRb);
	const CString& Name(){
		return m_strName;
	}
	
	void WriteAcDbHandle(const AcDbHandle& handle);  
	void WriteBool(bool bData);  
	void WriteDouble(DOUBLE dbData);  
	void WriteInt(INT nData);   
	void WritePoint3d(const AcGePoint3d& pt);
	void WriteString(const CString& strData); 
	void WriteVector3d(const AcGeVector3d& vector);  

	BOOL ReadAcDbHandle(AcDbHandle& handle);
	BOOL ReadBool(bool& bData);
	BOOL ReadDouble(DOUBLE& dbData);
	BOOL ReadInt(INT& nData);
	BOOL ReadPoint3d(AcGePoint3d& pt);
	BOOL ReadString(CString& strData);
	BOOL ReadVector3d(AcGeVector3d& vector);

	UeResbuf* FirstBuf(){
		return &m_buf;
	}

	UeResbuf* LastBuf(){
		return m_pLastBuf;
	}

private:
	CString m_strName;
	INT m_nState;
	UeResbuf m_buf;
	UeResbuf* m_pPos;
	UeResbuf* m_pPrevPos;
	UeResbuf* m_pLastBuf;
};

#endif // !defined(AFX_UEXDATA_H__9696EA68_F97E_4EF6_932A_C8C2F6B41010__INCLUDED_)
